package com.iwayin.web.action.search;

import java.util.List;

import com.iwayin.core.bo.ask.AskBO;
import com.iwayin.core.bo.user.UserBO;
import com.iwayin.core.vo.SearchVO;
import com.iwayin.web.action.BaseAction;
/**
 * 搜索
 * @author xiaobo.feng<xiaobo.feng@foxmail.com>
 *
 * Mar 26, 2012
 */
public class SearchAction extends BaseAction {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1356826359096656845L;
	
	private UserBO userBO;
	private AskBO askBO;
	private SearchVO query;
	private List<SearchVO> searchList;
	/**
	 * 模糊查询用户
	 * @return
	 */
	public String searchUser(){
		if(query==null){
			query = new SearchVO();
		}
		query.setLoginId(this.getLoginUser().getId());
		searchList = userBO.searchUser(query);
		return SUCCESS;
	}
	/**
	 * 模糊查询ask
	 * @return
	 */
	public String searchAsk(){
		if(query == null){
			query = new SearchVO();
		}
		query.setLoginId(this.getLoginUser().getId());
		searchList = askBO.searchAsks(query);
		return SUCCESS;
	}
	

	public void setUserBO(UserBO userBO) {
		this.userBO = userBO;
	}

	public List<SearchVO> getSearchList() {
		return searchList;
	}
	public void setAskBO(AskBO askBO) {
		this.askBO = askBO;
	}

}
